pay = int(input('输入应付多少: '))
money = 0
m1 = m2 = m3 = m5 = m10 = m20 = m50 = 0
while True:
    gave = input('收下积分: ')
    if gave == 'end':
        break
    money += int(gave)
print('实际收入的积分:', money)
change = money - pay
while True:
    if change == 0:
        break
    if change >= 50:
        m50 += 1
        change -= 50
    elif change >= 20:
        m20 += 1
        change -= 20
    elif change >= 10:
        m10 += 1
        change -= 10
    elif change >= 5:
        m5 += 1
        change -= 5
    elif change >= 3:
        m3 += 1
        change -= 3
    elif change >= 2:
        m2 += 1
        change -= 2
    elif change >= 1:
        m1 += 1
        change -= 1
if m50 != 0:
    print('50分:', m50, '张')
if m20 != 0:
    print('20分:', m20, '张')
if m10 != 0:
    print('10分:', m10, '张')
if m5 != 0:
    print('5分:', m5, '张')
if m3 != 0:
    print('3分:', m3, '张')
if m2 != 0:
    print('2分:', m2, '张')
if m1 != 0:
    print('1分:', m1, '张')
